home *** CD-ROM | disk | FTP | other *** search
- Path: news.uregina.ca!usenet
- From: Mike Hebert <hebert@cs.uregina.ca>
- Newsgroups: comp.lang.c
- Subject: Help with Structures
- Date: 25 Jan 1996 06:08:03 GMT
- Organization: University of Regina
- Message-ID: <4e76o3$iai@sue.cc.uregina.ca>
- NNTP-Posting-Host: hercules.cs.uregina.ca
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
-
- (Please respond via e-mail)
-
- First, let me give you a bit of a backgroud. I programmed with QuickBasic
- v4.5 (interfaced with assembly laguage) on and off for about 3 years. A
- few months ago, I thought it was time to move on to C (Watcom C v10.5 to
- be exact).
-
- I am now at the point where I am trying to convert my 16-bit QB-compatible
- assembly code into 32-bit Watcom C-compatible assembly code, and I've run
- into a minor problem.
-
- The specific procedure that I am trying to convert simply passes a pointer
- to a bitmap, a pointer to a screen buffer, and X and Y co-ordinates. The
- procedure simply copies everything ASAP.
-
- My problem is this: I want the first two dwords (long ints) in the bitmap
- array to be the width and height of the bitmap (respectively); how do I
- reference those first two elements as dwords (long ints) and refer to the
- rest of the array as bytes (chars)?
-
- I don't want to pass the width and height as seperate parameters because
- that would mean having to use the stack which would mess things up...
-
- If I use a struct, how do I reference it in the assembly procedure? For
- that matter, how do I set up the prototype so that I can use any structure
- using that definition?
-
- (PS: The reason I want to use dwords for the width and height in my
- algorithm is that it makes everything on the assembly side a little
- easier.)
-
-
- --------------------------------------------------------------------
- Michael Hebert E-mail: hebert@cs.uregina.ca
- Web page: http://www.cs.uregina.ca/~hebert
- --------------------------------------------------------------------
-
-
-